feat: support 120fps for Animated#51775
Conversation
e368c44 to
c679e4c
Compare
|
cc: @cipolleschi 🙏 |
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for working on this. IIRC, there is also some code in JS that hardcode 60 fps, but I don't remember where... can we make sure that all the references to 60 fps are handled?
We should also make similar changes on Android and...
...this should be behind a featureflag as it will change the behavior of the internal apps and we would like to have a quick killswitch to revert to previous behavior in case the crash rate raises.
|
Looks like for Android we will need to overwrite this: https://github.com/facebook/react-native/blob/d1efc5806d1d1232077e0638e252bcf970d81626/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/FrameBasedAnimationDriver.kt#L102 |
|
Any updates ? |
|
bump |
|
Sorry for no movement on this PR.. I'll try to prioritize it this week 🤞 |
3057571 to
82795dc
Compare
|
@YueLiXing did you re-install pods? |
beaad00 to
9cde3b1
Compare
There was a problem hiding this comment.
@cortinico @cipolleschi Can you help me understand why are there two turbo modules for animated? I found one is working only for iOS and one only for Android.. Not sure which one I should use
There was a problem hiding this comment.
Let's use NativeAnimatedHelper for this.
9cde3b1 to
509e976
Compare
|
@cipolleschi Should be ready to re-review. I've added Android support and feature flags |
509e976 to
d98a731
Compare
There was a problem hiding this comment.
Let's use NativeAnimatedHelper for this.
| { | ||
| if (!_displayLink && _activeAnimations.count > 0) { | ||
| _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(stepAnimations:)]; | ||
| _displayLink.preferredFramesPerSecond = [UIScreen mainScreen].maximumFramesPerSecond; |
There was a problem hiding this comment.
This needs the same feature flag gating
|
|
||
| CGFloat previousScale = _scale; | ||
| CGFloat targetFps = MAX(_maxFPS, 60.0); | ||
| CGFloat screenRefreshRate = [UIScreen mainScreen].maximumFramesPerSecond; |
There was a problem hiding this comment.
This should be the current refresh rate, otherwise we. may be giving a wrong signal
There was a problem hiding this comment.
This should be a separate PR
| import android.content.Context | ||
| import android.view.WindowManager | ||
|
|
||
| public fun getSingleFrameInterval(context: Context): Double { |
There was a problem hiding this comment.
Let's do Android in a separate PR
|
|
||
| val windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager | ||
|
|
||
| val refreshRate = windowManager.defaultDisplay.supportedRefreshRates.maxOrNull() |
There was a problem hiding this comment.
|
any update? |
|
@okwasniewski wen pls |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |

Summary:
This PR adds support for 120fps animations for the Animated API. The frame length is no longer hard coded to be 60.
ScreenRecording_06-03-2025.5-49-22.PM_1.MP4
TODO List
Changelog:
[GENERAL] [ADDED] - support 120fps for Animated
Test Plan:
Run some animations and check their smoothness on Device (!).